/**
 * Project Name:template-web
 * File Name   :IBaseService.java
 * Package Name:org.cn.template.component.service
 * Date:2015年9月27日下午3:50:42
 * Copyright (c) 2015, http://my.oschina.net/httpssl All Rights Reserved.
 *
*/

package org.cn.template.component.service;

import java.util.List;
import java.util.Map;

import org.cn.template.component.domain.PersistentModel;
import org.cn.template.component.page.PagerModel;

/**
 * ClassName:IBaseService <br/>
 * Function :TODO ADD FUNCTION. <br/>
 * Reason	:TODO ADD REASON. <br/>
 * Date     :2015年9月27日 下午3:50:42 <br/>
 * @author  :http://my.oschina.net/httpssl
 * @email   :491835898@QQ.COM
 * @since   :JDK 1.7
 * @see 	 
 */
public interface IBaseService<T extends PersistentModel>
{
	public T insertOne(T model) throws Exception;

	public void insertBatch(final List<T> models) throws Exception;

	public int deleteById(@SuppressWarnings("rawtypes")Map param) throws Exception;

	public int delete(T param) throws Exception;

	public int updateById(T model) throws Exception;

	public <V extends T> V selectOne(T query) throws Exception;

	public <V extends T> V selectById(@SuppressWarnings("rawtypes") Map param) throws Exception;

	public <V extends T> List<V> selectList(T query) throws Exception;
	
	public <V extends T> List<V> selectList(String statement,@SuppressWarnings("rawtypes") Map map) throws Exception;
	
	public List<?> selectMapList(String statement,@SuppressWarnings("rawtypes")Map map) throws Exception;

	public <V extends T> List<V> selectList(T query,@SuppressWarnings("rawtypes") Map pageable) throws Exception;

	public Long selectListCount(T query) throws Exception;
	
	/**
	 * 获取分页数据(自定义)
	 * 
	 * @param map
	 * @return
	 * @throws Exception
	 */
	public PagerModel getPagerModel(@SuppressWarnings("rawtypes")Map paramMap) throws Exception;
	
}
